<?php

use App\Http\Controllers\Api\CommonController;
use App\Http\Controllers\Api\JPushController;
use App\Http\Controllers\Api\WeixinMpController;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

//检查用户token、平台标识
Route::group(['middleware' => 'api', 'prefix' => 'v1'], function () {
    // 短信发送
    Route::get('sms/code', [CommonController::class, 'sendCode']);
    // 登录
    Route::post('login', [CommonController::class, 'login']);
    // 微信授权登录
    Route::post('wx/login', [CommonController::class,'wxLogin']);

    //Secret Token;
    Route::get('wx/secrettoken', [CommonController::class,'wxSecretToken']);

    // 获取配置-出发时间
    Route::get('get/service/phone', [CommonController::class,'getServicePhone']);
    //Secret data;
    Route::post('wx/secret', [CommonController::class,'wxSecret']);

    // 账号注销
    Route::post('account/cancellation', [CommonController::class,'accountCancellation']);

    // 消息推送
    Route::get('jPush', [JPushController::class,'jPush']);
    // 云存储文件上传
    Route::post('file/ali/upload', [CommonController::class, 'aliUpload']);

    // 获取配置-出发时间
    Route::get('get/time', [CommonController::class,'getConfigTime']);
    // 是否能联系司机
    Route::get('contact', [CommonController::class,'contactDriver']);
    // 获取出车类型和车辆类型 POINT 20230809 by LC
    Route::get('get/vehicleConfig', [CommonController::class,'getVehicleConfig']);
    // 获取出车类型和车辆类型 POINT 20230817 by LC
    Route::get('get/vehicleAirportConfig', [CommonController::class,'vehicleAirportConfig']);
    // 获取出车类型和车辆类型 DIGITAL 20231018 by LC
    Route::get('get/digital/vehicleConfig', [CommonController::class,'getVehicleConfigDigital']);
    // 获取出车类型和车辆类型 DIGITAL 20231018 by LC
    Route::get('get/digital/vehicleAirportConfig', [CommonController::class,'vehicleAirportConfigDigital']);

    // 切换身份
    Route::post('checkout/identity', [CommonController::class, 'checkoutIdentity']);
    // 身份列表
    Route::get('checkout/list', [CommonController::class, 'checkoutList']);

    //SDK活体检测结果查询
    Route::post('life-sdk/check', [CommonController::class,'getFaceVerify']);
    //人脸身份证比对
    Route::post('face/identity/check', [CommonController::class,'faceIdCardCompare']);

    //=======================================二维码============================================================
    // 生成二维码（司机）
    Route::get('qrcode/my/driver/info', [CommonController::class,'qrDriverCode']);
    // 二维码（司机）信息
    Route::get('qrcode/driver/info', [CommonController::class,'qrcodeDriverInfo']);

    // 生成二维码（村民）
    Route::get('qrcode/my/villager/info', [CommonController::class,'qrVillagerCode']);
    // 二维码（村民）信息
    Route::get('qrcode/villager/info', [CommonController::class,'qrcodeVillagerInfo']);

    // 生成二维码（志愿者订单）
    Route::get('qrcode/my/volunteer/info', [CommonController::class,'qrVolunteerCode']);
    // 二维码（志愿者订单）信息
    Route::get('qrcode/volunteer/info', [CommonController::class,'qrcodeVolunteerInfo']);

    // 生成二维码（订单）
    Route::get('qrcode/order/info', [CommonController::class,'qrOrderCode']);
    // 二维码（订单）核销
    Route::get('qrcode/order/ord', [CommonController::class,'qrcodeOrderInfo']);

    // 生成二维码（活动订单）
    Route::get('qrcode/activity/order/info', [CommonController::class,'qrActivityOrderCode']);
    // 二维码（活动订单）核销
    Route::get('qrcode/activity/order/ord', [CommonController::class,'qrcodeActivityOrderInfo']);
    // 二维码 扫活动的二维码，带司机订单
    Route::get('qrcode/activity/ord', [CommonController::class,'qrcodeActivity']);

    //=======================================二维码============================================================

    // 小程序 公告
    Route::get('notice',[WeixinMpController::class,'getMpNotice']);
    // 小程序 停止下单
    Route::get('stop/info',[WeixinMpController::class,'getStopInfo']);
    //村民
    Route::group(['prefix' => 'villager'], function () {
        require base_path('routes/villager/routes.php');
    });

    //村委会、居委会
    Route::group(['prefix' => 'villager/committee'], function () {
        require base_path('routes/villager_committee/routes.php');
    });

    //志愿者
    Route::group(['prefix' => 'volunteer'], function () {
        require base_path('routes/volunteer/routes.php');
    });

    //捐赠
    Route::group(['prefix' => 'donation'], function () {
        require base_path('routes/donation/routes.php');
    });

    //司机
    Route::group(['prefix' => 'driver'], function () {
        require base_path('routes/driver/routes.php');
    });
});

